*, *:before, *:after {
  box-sizing: inherit;
}

.ads {
  width: 50%;
  flex:0 0 12em;
  padding: 1em;
  margin:0 auto;
  border-radius: 3px;
  display: flex;

  div{
    //display: flex;
  }
}


/* 使用Flex时 外层元素必须设置flex显示 */
.button {
  text-decoration: none;
  flex-grow: 1;
  text-align: center;
  cursor: pointer;
  background: none;
  padding: 1em 2em;
  color: inherit;
  position: relative;
  z-index: 1;
  -webkit-backface-visibility: hidden;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 3px solid;
  overflow: hidden;
  -webkit-transition: border-color .3s,color .3s;
  transition: border-color .3s,color .3s;
  -webkit-transition-timing-function: cubic-bezier(0.2,1,0.3,1);
  transition-timing-function: cubic-bezier(0.2,1,0.3,1);

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 150%;
    height: 100%;
    background: #37474f;
    z-index: -1;
    -webkit-transform: rotate3d(0,0,1,-45deg) translate3d(0,-3em,0);
    transform: rotate3d(0,0,1,-45deg) translate3d(0,2,0);
    -webkit-transform-origin: 0 100%;
    transform-origin: 0 100%;
    -webkit-transition: -webkit-transform .3s,opacity .3s,background-color .3s;
    transition: transform .3s,opacity .3s,background-color .3s;
  }

  &:hover {
    color: #fff;
    border-color: #ED254E;

    &::before {
      opacity: 1;
      background-color: #ED254E;
      -webkit-transform: rotate3d(0,0,1,0deg);
      transform: rotate3d(0,0,1,0deg);
      -webkit-transition-timing-function: cubic-bezier(0.2,1,0.3,1);
      transition-timing-function: cubic-bezier(0.2,1,0.3,1);
    }
  }
}